package com.ww.springboot.boot.thread.study.base.lock.aqs.demo.lock2;


import com.ww.springboot.boot.thread.study.base.lock.aqs.util.ThreadPrintUtil;

/**
 * 描述：
 *
 * @author 🧑 ‍wanwei
 * @since 2023-03-17 09:49
 */
public class LockDemo1 {

    public static void main(String[] args) {
        //1.创建简单重入锁 测试是否可重入获取锁
        MySimpleReentrantLock mySimpleReentrantLock = new MySimpleReentrantLock();
        mySimpleReentrantLock.lock();
        ThreadPrintUtil.sout("第一次获取锁");
        mySimpleReentrantLock.lock();
        ThreadPrintUtil.sout("第二次获取锁");
        mySimpleReentrantLock.lock();
        ThreadPrintUtil.sout("第三次获取锁");
        mySimpleReentrantLock.lock();
        ThreadPrintUtil.sout("第四次获取锁");

    }
}
